import axios from '@/request.js'
import { queryParams } from "@/composables/util"
export function login(data) {
    return axios.post("/login", data);
  }

export function getinfo(){
  return axios.get("/admin/getinfo");
} 

export function updatepwd(data) {
  return axios.post("/admin/updatepwd", data);
}

export function update(id,data) {
  return axios.post(`/admin/update?id=${id}`, data);
}

export function getadmin(page,query){
  let r = queryParams(query)
  return axios.get(`/admin?page=${page}${r}`);
} 

export function create(data) {
  return axios.post("/admin/create", data);
}

export function del(id){
  return axios.post(`/admin/del/id/${id}`);
}

// 圖片上傳
export const uploadImageAction = import.meta.env.VITE_APP_BASE_API+"/upload"
